package com.framework.dao.app;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.framework.entity.or.AppDiscoverArticle;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 发现--文章
 * @author wq
 */
public interface AppDiscoverArticleDao extends BaseMapper<AppDiscoverArticle> {
    /**
     * 分页查询
     * @param deptId
     * @param start
     * @return
     */
    @Select("select article_id as articleId," +
            "title,author,content,jump_url as jumpUrl,dept_id as deptId,type,create_time as createTime," +
            "sort,date_format(write_date,'%Y-%m-%d') as writeDate,state,author_head as authorHead" +
            " from app_discover_article where dept_id=#{deptId} and state=1 order by create_time desc,sort asc limit ${start},10")
    List<AppDiscoverArticle> queryListByLimit(@Param("deptId") Long deptId, @Param("start") Integer start);
}
